package com.lihaogn.sell.utils;

import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;

import java.util.Map;

/**
 * @FileName: HttpClientUtil
 * @Description: TODO
 * @Author: lihao
 * @Date: 2019-06-27 09:41
 * @Version: 1.0
 */
public class HttpClientUtil {

    public static String doGet(String url) {
        RestTemplate restTemplate = new RestTemplate();
        ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class);

        return responseEntity.getBody();
    }

    public static String doGet(String url, Map paramMap) {
        RestTemplate restTemplate = new RestTemplate();
        ResponseEntity<String> responseEntity = restTemplate.getForEntity(url, String.class,paramMap);

        return responseEntity.getBody();
    }

}
